<!--
 * Copyright TLR Team, Inc. All Rights Reserved.
-->
<div class="tlr-assessment-container">
    <form class="form-horizontal">
        <div class="form-group">
            <div class="col-sm-12"
                 style="border-bottom: 1px solid #BEBEBE; padding-bottom: 10px; font-size: 20px;">
                <label class="col-sm-3 control-label">人体结构图</label>
            </div>
        </div>
        <div class="row">
            <div class="col-lg-12">
                <!-- Tab panes -->
                <div class="tab-content">
                    <div role="tabpanel" class="tab-pane active"
                         style="padding-top: 20px;">
                        <table class="table table-bordered table-hover" cellspacing="0"
                               width="100%">
                            <thead class="tlr-table-header">
                                <tr>
                                    <th>编号</th>
                                    <th>人体结构图片列表(已上传)</th>
                                </tr>
                            </thead>
                            <tr ng-repeat="pic in bodyMapList track by $index">
                                <td>{{$index}}</td>
                                <td><a
                                        href="device/rest/bodymap/download?filename={{pic}}&assessment={{assessment.id}}">{{pic}}</a></td>
                            </tr>
                        </table>
                    </div>
                </div>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-2 control-label">选择上传的文件</label>
            <div class="col-sm-9">
                <input type="file" nv-file-select="" uploader="uploader" />
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-2 control-label">上传后的文件名</label>
            <div class="col-sm-9">
                <input type="text" class="form-control"
                       ng-model="uploadinfo.newname">
            </div>
            <input class="btn btn-default" type="button" value="修改文件名"
                   ng-click="changeUploadFileName()">
        </div>
        <div class="col-sm-9" style="margin-bottom: 40px">

            <table class="table">
                <thead>
                    <tr>
                        <th width="20%">文件名</th>
                        <th width="20%">上传文件名</th>
                        <th ng-show="uploader.isHTML5">大小</th>
                        <th ng-show="uploader.isHTML5">进度</th>
                        <th>状态</th>
                        <th>操作</th>
                    </tr>
                </thead>
                <tbody>
                    <tr ng-repeat="item in uploader.queue track by $index">
                        <td>{{ getOldName($index)}}</td>
                        <td><strong>{{ item.file.name}}</strong></td>
                            <td ng-show="uploader.isHTML5" nowrap>{{
                                                    item.file.size / 1024/1024|number:2 }} MB</td>
                        <td ng-show="uploader.isHTML5">
                            <div class="progress" style="margin-bottom: 0;">
                                <div class="progress-bar" role="progressbar"
                                     ng-style="{ 'width': item.progress + '%' }"></div>
                            </div>
                        </td>

                        <td class="text-center"><span ng-show="item.isSuccess"><i
                                    class="glyphicon glyphicon-ok"></i></span> <span
                                ng-show="item.isCancel"><i
                                    class="glyphicon glyphicon-ban-circle"></i></span> <span
                                ng-show="item.isError"><i
                                    class="glyphicon glyphicon-remove"></i></span></td>
                        <td nowrap>
                            <button type="button" class="btn btn-success btn-xs"
                                    ng-click="item.upload()"
                                    ng-disabled="item.isReady || item.isUploading || item.isSuccess">
                                <span class="glyphicon glyphicon-upload"></span> 上传
                            </button>
                            <button type="button" class="btn btn-warning btn-xs"
                                    ng-click="item.cancel()" ng-disabled="!item.isUploading">
                                <span class="glyphicon glyphicon-ban-circle"></span> 取消
                            </button>
                            <button type="button" class="btn btn-danger btn-xs"
                                    ng-click="item.remove()">
                                <span class="glyphicon glyphicon-trash"></span> 移除
                            </button>
                        </td>
                    </tr>
                </tbody>
            </table>

            <div>
                <div>
                    上传进度:
                    <div class="progress" style="">
                        <div class="progress-bar" role="progressbar"
                             ng-style="{ 'width': uploader.progress + '%' }"></div>
                    </div>
                </div>
                <button type="button" class="btn btn-success btn-s"
                        ng-click="uploader.uploadAll()"
                        ng-disabled="!uploader.getNotUploadedItems().length">
                    <span class="glyphicon glyphicon-upload"></span> 全部上传
                </button>
                <button type="button" class="btn btn-warning btn-s"
                        ng-click="uploader.cancelAll()" ng-disabled="!uploader.isUploading">
                    <span class="glyphicon glyphicon-ban-circle"></span> 全部取消
                </button>
                <button type="button" class="btn btn-danger btn-s"
                        ng-click="uploader.clearQueue()"
                        ng-disabled="!uploader.queue.length">
                    <span class="glyphicon glyphicon-trash"></span> 全部移除
                </button>
            </div>

        </div>




        <div class="col-sm-9">
            <input class="btn btn-default" style="float: right;" type="button"
                   value="下一页" ng-click="nextPage(17)"> <input
                   class="btn btn-default" style="float: right; margin-right: 30px;"
                   type="button" value="上一页" ng-click="prevPage(15)">
        </div>
    </form>
</div>
